#pragma once

#include "Sampler.h"
#include "Geometry.h"
#include <vector>

class GridBasedSampler : public Sampler
{
public:
	GridBasedSampler(float gridSize);
	virtual ~GridBasedSampler(void);

	virtual void setBounds(int left, int right, int top, int bottom, float radius);

	virtual Vector2 sample();

	virtual void lastSampleClearFeedback(bool value);

protected:
	void resetUnoccupiedCells();

	float gridSize_;
	float cellSize_;
	int cellCountX_, cellCountY_;
	int currentCellIndex;

	std::vector<int> unoccupiedCells_;
};

